/* ===== CSS 变量定义 ===== */
:root {
  /* 颜色变量 */
  --color-white: #fff;
  --color-primary: #409eff;
  --color-success: #67c23a;
  --color-warning: #e6a23c;
  --color-danger: #f56c6c;
  --color-info: #909399;
  --color-text-primary: #303133;
  --color-text-regular: #606266;
  --color-text-secondary: #909399;
  --color-text-placeholder: #c0c4cc;
  --color-border-light: #e4e7ed;
  --color-border-lighter: #ebeef5;
  --color-background: #f8f9fa;
  --color-background-light: #fafafa;

  /* 间距变量 */
  --spacing-xs: 5px;
  --spacing-sm: 8px;
  --spacing-md: 12px;
  --spacing-lg: 16px;
  --spacing-xl: 20px;
  --spacing-xxl: 24px;
  --spacing-xxxl: 30px;

  /* 字体大小变量 */
  --font-size-xs: 10px;
  --font-size-sm: 12px;
  --font-size-base: 14px;
  --font-size-lg: 16px;
  --font-size-xl: 18px;

  /* 圆角变量 */
  --border-radius-sm: 4px;
  --border-radius-base: 6px;
  --border-radius-lg: 8px;

  /* 阴影变量 */
  --box-shadow-light: 0 2px 4px rgba(0, 0, 0, 0.1);
  --box-shadow-base: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* ===== 页面布局组件 ===== */
.cu-common-page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--color-white);
  padding: var(--spacing-lg) var(--spacing-xxl);
  margin-bottom: var(--spacing-xl);
  border-radius: var(--border-radius-sm);
  box-shadow: var(--box-shadow-light);
}

.options {
  display: flex;
  gap: var(--spacing-xs);
}

.main {
  background: var(--color-white);
  border-radius: var(--border-radius-sm);
  padding: var(--spacing-xxl);
  box-shadow: var(--box-shadow-light);
}

/* ===== 详情区域组件 ===== */
.detail-section {
  margin-bottom: var(--spacing-xxxl);
  padding: var(--spacing-xl);
  border: 1px solid var(--color-border-light);
  border-radius: var(--border-radius-lg);
  background: var(--color-background-light);
}

.section-title {
  display: flex;
  align-items: center;
  margin-bottom: var(--spacing-xl);
  font-size: var(--font-size-lg);
  font-weight: 600;
  color: var(--color-text-regular);
}

/* ===== 内容容器组件 ===== */
.follow-up-container,
.system-stats,
.feedback-content,
.evaluation-stats {
  background: var(--color-white);
  border-radius: var(--border-radius-base);
}

.system-stats {
  display: flex;
  flex-direction: column;
}

.follow-up-container,
.system-stats,
.feedback-content {
  padding: var(--spacing-xl);
}
/* ===== 评价统计组件 ===== */
.evaluation-stats {
  padding: var(--spacing-xl) 0;

  .el-form-item {
    margin-bottom: 15px;
  }

  /* 新评价卡片布局 */
  .evaluation-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-xl);
  }

  .rating-card,
  .score-card {
    position: relative;
    display: flex;
    flex-direction: column;
    border-radius: var(--border-radius-lg);
    background: linear-gradient(135deg, rgba(64,158,255,0.08), rgba(103,194,58,0.08));
    box-shadow: var(--box-shadow-light);
    overflow: hidden;
    transition: transform .2s ease, box-shadow .2s ease;
  }

  .rating-card:hover,
  .score-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--box-shadow);
  }

  .card-header {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-lg) var(--spacing-xl) var(--spacing-md);
    color: var(--color-text-regular);

    .card-title {
      font-size: var(--font-size-lg);
      font-weight: 600;
    }

    i {
      color: var(--color-warning);
      font-size: var(--font-size-lg);
    }
  }

  .card-body {
    padding: var(--spacing-xl);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
  }

  /* 评分胶囊标签 */
  .rating-pill {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: 6px 10px;
    border-radius: 999px;
    background: var(--color-background);
    border: 1px solid var(--color-border-light);
  }

  .rating-label {
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--color-white);
    padding: 4px 8px;
    border-radius: var(--border-radius-sm);

    &.label-unsatisfied { background-color: var(--color-danger); }
    &.label-average { background-color: var(--color-warning); }
    &.label-satisfied { background-color: var(--color-success); }
    &.label-very-satisfied { background-color: var(--color-primary); }
  }

  .rating-value {
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
  }

  /* 综合评分高亮展示 */
  .score-highlight {
    display: flex;
    align-items: baseline;
    gap: 4px;
    line-height: 1;
  }
  .score-number {
    font-size: 34px;
    font-weight: 700;
    color: var(--color-primary);
  }
  .score-unit {
    font-size: var(--font-size-base);
    color: var(--color-text-regular);
  }
  .score-meta {
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
  }

  .score-bar {
    position: relative;
    height: 6px;
    border-radius: 999px;
    background: var(--color-border-light);
    overflow: hidden;
  }
  .score-bar__fill {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 0;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--color-primary), #67c23a);
    transition: width .35s ease;
  }

  /* 渐隐动画 */
  .fade-enter-active, .fade-leave-active { transition: opacity .2s ease; }
  .fade-enter, .fade-leave-to { opacity: 0; }

  /* 响应式 */
  @media (max-width: 1200px) {
    .evaluation-grid { grid-template-columns: 1fr; }
  }
}

/* ===== 表单辅助组件 ===== */
.form-tip {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  margin-top: var(--spacing-xs);
  line-height: 1.4;
}

.income-description {
  font-size: var(--font-size-sm);
  color: var(--color-success);
  margin-top: var(--spacing-xs);
  font-weight: 500;
  line-height: 1.4;
}

/* ===== 布局组件 ===== */
.trusteeship-summary {
  display: grid;
  margin-bottom: var(--spacing-xl);
}

.section-divider {
  height: 1px;
  background: linear-gradient(to right, var(--color-border-light), var(--color-text-secondary), var(--color-border-light));
  margin: var(--spacing-xl) 0;
}

.detail-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--spacing-xl);
  margin-bottom: var(--spacing-xl);
}

/* ===== 标题组件 ===== */
.group-title {
  font-size: var(--font-size-base);
  font-weight: 600;
  color: var(--color-text-regular);
  margin-bottom: var(--spacing-lg);
  display: flex;
  align-items: center;

  .bold-title {
    position: relative;

    span {
      font-size: var(--font-size-sm);
      color: #999;
      font-weight: 500;
    }

    &::after {
      content: '';
      display: block;
      width: 2px;
      height: 15px;
      background: #44b50b;
      border-radius: var(--spacing-xs);
      position: absolute;
      left: calc(-1 * var(--spacing-xs));
      top: 0;
    }
  }
}

/* ===== 数据网格组件 ===== */
.data-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--spacing-xl);
  margin-bottom: var(--spacing-xl);

  &.border-title {
    border: 1px solid #f4f4f4;
  }

  .data-system-list {
    flex: 1;
    display: flex;

    span:nth-child(1) {
      display: block;
      width: 50%;
      background: #f4f4f4;
      color: #898989;
      padding: var(--spacing-sm) var(--spacing-xs);
    }

    span:nth-child(2) {
      display: flex;
      justify-content: center;
      align-items: center;
      flex: 1;
    }
  }
}

.data-text {
  font-size: var(--font-size-lg);
  font-weight: 600;
  color: var(--color-primary);
}

.system-usage .data-grid {
  grid-template-columns: 1fr;
}

/* ===== 表单项组件 ===== */
.vertical-form-item {
  margin-bottom: 25px;
}

.vertical-label {
  font-size: var(--font-size-base);
  font-weight: 600;
  color: var(--color-text-regular);
  margin-bottom: var(--spacing-xs);
  line-height: 1.4;
}

/* 垂直布局表单项样式 */
.vertical-form-item.el-form-item {
  display: flex !important;
  flex-direction: column !important;

  .el-form-item__label {
    float: none !important;
    display: block !important;
    text-align: left !important;
    width: auto !important;
    margin-bottom: var(--spacing-sm) !important;
    line-height: 1.5;
    margin-right: 0 !important;
  }

  .el-form-item__content {
    margin-left: 0 !important;
    width: 100% !important;
  }

  &.is-required {
    .el-form-item__label::before {
      display: none !important;
    }

    .vertical-label::before {
      content: '*';
      color: var(--color-danger);
      margin-right: var(--spacing-sm);
    }
  }
}

.vertical-form-item .el-form-item__content {
  margin-left: 0 !important;
  width: 100% !important;
  margin-top: var(--spacing-sm);
}

/* ===== 其他服务组件 ===== */
.other-services-section {
  margin-top: var(--spacing-xl);
}

/* ===== 空数据提示组件 ===== */
.empty-data {
  text-align: center;
  padding: 40px var(--spacing-xl);
  color: var(--color-text-secondary);
  font-size: var(--font-size-base);

  i {
    font-size: var(--spacing-xxl);
    margin-bottom: var(--spacing-xs);
    display: block;
  }

  span {
    display: block;
  }
}

.other-services-header {
  display: flex;
  align-items: center;
  margin-bottom: 15px;
  padding-bottom: var(--spacing-xs);
  border-bottom: 1px solid var(--color-border-light);
}

.other-services-title {
  font-size: var(--font-size-base);
  font-weight: 600;
  color: var(--color-text-regular);
  margin-right: var(--spacing-xl);
}

.no-other-services {
  text-align: center;
  padding: var(--spacing-xxxl);
  color: var(--color-text-secondary);
  border-radius: var(--border-radius-sm);
  border: 1px dashed #d9d9d9;

  i {
    font-size: var(--spacing-xxl);
    margin-bottom: var(--spacing-sm);
    display: block;
  }
}

.other-service-item {
  border: 1px solid #e9ecef;
  border-radius: var(--border-radius-base);
  padding: 15px;
  margin-bottom: 15px;
  transition: all 0.3s ease;

  &:hover {
    border-color: var(--color-primary);
    box-shadow: var(--box-shadow-base);
  }
}

/* ===== 输入框组件 ===== */
.input-with-select {
  .el-input-group__prepend {
    background-color: var(--color-white);
    border-color: #dcdfe6;
    color: var(--color-text-regular);

    .el-select {
      width: 120px;

      .el-input__inner {
        border: none;
        background: transparent;
        color: var(--color-text-regular);
        font-size: var(--font-size-base);
      }

      .el-input__suffix {
        right: var(--spacing-xs);
      }
    }
  }

  .el-input__inner {
    border-left: none;
  }

  &:hover .el-input-group__prepend {
    border-color: var(--color-text-placeholder);
  }

  &.is-focus .el-input-group__prepend {
    border-color: var(--color-primary);
  }
}

/* ===== 响应式设计 ===== */
@media (max-width: 768px) {
  .trusteeship-summary,
  .detail-row,
  .data-grid {
    grid-template-columns: 1fr;
  }

  .other-service-item .el-row .el-col {
    margin-bottom: var(--spacing-xs);
  }

  .other-services-header {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--spacing-xs);
  }

  .input-with-select .el-input-group__prepend .el-select {
    width: 100px;
  }
}
